var appid = 'wx15f1e1273d0a6cbc',	//开放平台appid
	partnerid = '1521321841'	;	//商户号
	
	
var data = {
	appid:appid,			//appid
	mch_id:partnerid,		//商户号
	device_info:'web',		//设备号 默认web
	nonce_str:'5K8264ILTKCH16CQ2502SI8ZNMTM67VS',	//随机字符串
	sign:'C380BEC2BFD727A4B6845133519F3AD6',				//签名
	sign_type:'MD5',		//签名类型
	body:'body',			//商品描述
	detail:'detail',		//商品详情
	attach:'attach',		//附带数据
	out_trade_no:'20150806125346',	//商户订单号
	fee_type:'CNY',		//货币类型
	total_fee:1,		//总金额  分
	spbill_create_ip:'123.12.12.123',	//调用微信支付API的机器IP
	time_start:'20191225091010',		//订单生成时间
	time_expire:'20251227091010',		//交易结束时间，订单失效时间
	goods_tag:'WXG',			//订单优惠标记
	notify_url:'http://www.weixin.qq.com/wxpay/pay.php',		//回调地址
	trade_type:'APP',		//交易类型
	limit_pay:'no_credit',			//指定 不能用信用卡
	receipt:'Y',				//开发票入口开放标识
}
	

var varpay = {
    appid: "wx15f1e1273d0a6cbc",
    noncestr: "oUn3BJl37NhyEPgf",
    package: "Sign=WXPay",
    partnerid: "1230636401",
    prepayid: "wx20151203182611a03572a62d0054237692",
    timestamp: "1449138371",
    sign: "313966BE242897F2A82090190630A2D0"
}




   
function getsign(data){
	var str =   'appid='+data.appid+'&'+
				'body='+data.body+'&'+
				'mch_id='+data.mch_id+'&'+
				'nonce_str='+data.nonce_str+'&'+
				'notify_url='+data.notify_url+'&'+
				'out_trade_no='+data.out_trade_no+'&'+
				'spbill_create_ip='+data.spbill_create_ip+'&'+
				'total_fee='+data.total_fee+'&'+
				'trade_type='+data.trade_type+'&';
}
                  

//预支付
function prepaid(){
	$.ajax({
		type: "POST",
		url: 'https://api.mch.weixin.qq.com/pay/unifiedorder',
		dataType: "json",
		data: data,
		error: function(err) {
			console.log("失败:" + JSON.stringify(err));
			mui.toast("网络出错，请重试！");
		},
		success: function(res) {
			console.log(res);
		}
	});
	
}
